/*
 */
package org.hook.showcase.persistence.mybatis;


/**
 * @author suwuqiang 2011-8-16
 */
public class DataSourceContextHolder {
	private static final ThreadLocal<String> contextHolder = new ThreadLocal<String>() {
		protected synchronized String initialValue() {
			return DataSourceConstants.DATA_SOUCE_TARGET_DEFAULT;
		}
	};

	public static void setDataSourceType(String dataSourceType) {
		contextHolder.set(dataSourceType);
	}

	public static String getDataSourceType() {
		return contextHolder.get();
	}

	public static void clearDataSourceType() {
		contextHolder.remove();
	}
}
